import { ReactElement } from 'react'
import { CloseCircleOutlined } from '@ant-design/icons'
import style from '../index.module.less'

interface Props {
  value: string
  onChange: (v: string) => void
}

function Main ({ value, onChange }: Props): ReactElement {
  if (value.length) {
    return <div />
  }
  return (
    <div className={style['input-clear-btn']}>
      <CloseCircleOutlined onClick={() => onChange('')} />
    </div>
  )
}

export default Main
